/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpa.sessions;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import jpa.entities.AdvForProvider;

/**
 *
 * @author JAVA
 */
@Stateless
public class AdvForProviderFacade extends AbstractFacade<AdvForProvider> {
    @PersistenceContext(unitName = "MySweetHomePU")
    private EntityManager em;
    private Object userName;

    protected EntityManager getEntityManager() {
        return em;
    }

    public AdvForProviderFacade() {
        super(AdvForProvider.class);
    }

    public boolean addProvider(int id, String name, String email, String address, String operationField, String service, String isApprove, String username) {
        em.createNamedQuery("AddAdvForProvider").setParameter("id", id).setParameter("name", name).setParameter("address", address).setParameter("operationField", operationField).setParameter("service", service).setParameter("isApprove", isApprove).setParameter("userName", userName);
        return false;
    }

}
